<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<shiro:hasPermission name="userdetails:select">
	<div class="content1">
		<div class="header">
			<h1 class="page-title">用户类型列表</h1>
			<ul class="breadcrumb">
				<li>用户明细</li>
				<li class="active">用户类型列表</li>
			</ul>
		</div>
		<div class="main-content">
			<div class="row">
				<div class="col-md-2">
					<div class="form-group">
						<div class="input-group">
							<div class="input-group-addon">手机号</div>
							<input class="form-control" type="text" id="phoneNum">
						</div>
					</div>
				</div>
				<div class="col-md-2">
					<button type="button" class="btn btn-primary btn-small btn-block"
						id="query">
						<i class="glyphicon glyphicon-search"></i> 查询
					</button>
				</div>
				
				<div class="col-md-1">	
					<div class="form-group">
						<a class="btn btn-primary btn-small btn-block" id="message_export" onclick="exportMessage();">导出EXCEL</a>
					</div>				
				</div>
			</div>
			<table id="example" class="table"></table>
		</div>
		<script>
			function exportMessage(){
				var href="export/userdetails.htm"
						+"?phoneNum="+$("#phoneNum").val()
						+"&customerA.phoneType="+$("#customerA.phoneType").val()
						+"&createTime="+$("#createTime").val()
						+"&lastLoginTime="+$("#lastLoginTime").val();
						+"&viewCode="+$("#viewCode").val();
						+"&state="+$("#state").val();
				$('#message_export').attr("href",href);
			}
			
			//表格的初始化
			$(document).ready(function() {
				var table = $('#example').initTable({
					sAjaxSource:"userdetails/initTable.htm",
					aoColumns:[
			            { 
			              "data": "phoneNum",
			              "sTitle":"客户手机号",
			              'sClass':"text-center"
			            },
			            { 
			              "data": "phoneType",
			              "sTitle":"手机型号",
			              'sClass':"text-center",
				        },
			            { 
			              "data": "cardNum",
			              "sTitle":"银行卡编号",
			              'sClass':"text-center"
				         },
				         { 
				              "data": "bankName",
				              "sTitle":"银行卡名称",
				              'sClass':"text-center"
					     },
					     { 
				              "data": "mobileNo",
				              "sTitle":"银行预留手机号",
				              'sClass':"text-center"
					     },
					     { 
				              "data": "bankState",
				              "sTitle":"银行卡状态",
				              'sClass':"text-center",
				              "mRender": function(data, type, full) { 
				                	if(data == 1){
										return "<font>正常</font>";
									}else if(data == 2){
										return "<font>锁定</font>";
									}else if(data == 3){
										return "<font>冻结</font>";
									}else if(data == 4){
										return "<font>审核中</font>";
									}else if(data == 5){
										return "<font>通过</font>";
									}else if(data == 6){
										return "<font>审核不通过</font>";
									}else if(data == 7){
										return "<font>删除</font>";
									}else{
										return "<font>未知</font>";
									}
				                } 
					        },
					        { 
					              "data": "isDefault",
					              "sTitle":"是否默认银行卡",
					              'sClass':"text-center",
					              "mRender": function(data, type, full) { 
					                	if(data == 0){
											return "<font>非默认</font>";
										}else if(data == 1){
											return "<font>默认</font>";
										}else{
											return "<font>未知</font>";
										}
					                } 
						     },
						     { 
					              "data": "cardType",
					              "sTitle":"银行卡类型",
					              'sClass':"text-center",
					              "mRender": function(data, type, full) { 
					                	if(data == 0){
											return "<font>借记卡</font>";
										}else if(data == 1){
											return "<font>贷记卡</font>";
										}else{
											return "<font>未知</font>";
										}
					                } 
						     },
						     { 
					              "data": "repaymentMoney",
					              "sTitle":"还款金额",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "rateMoney",
					              "sTitle":"利息",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "dateWithdraw",
					              "sTitle":"实际贷款天数",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "overdueDay",
					              "sTitle":"逾期天数",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "overMoney",
					              "sTitle":"逾期费",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "instalPeriod",
					              "sTitle":"分期期数",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "repaymentPeriod",
					              "sTitle":"还款期数",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "trueQuota",
					              "sTitle":"实际到账金额",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "withdrawState",
					              "sTitle":"还款状态说明",
					              'sClass':"text-center",
					              "mRender": function(data, type, full) { 
					                	if(data == 0){
											return "<font>体现中</font>";
										}else if(data == 1){
											return "<font>体现成功</font>";
										}else if(data == 1){
											return "<font>全部提现</font>";
										}else if(data == 1){
											return "<font>体现失败</font>";
										}else if(data == 1){
											return "<font>款款中</font>";
										}else{
											return "<font>未知</font>";
										}
					                } 
						     },
						     { 
					              "data": "withdrawDay",
					              "sTitle":"贷款天数",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "quota",
					              "sTitle":"贷款金额",
					              'sClass':"text-center"
						     },
						     { 
					              "data": "comUseType",
					              "sTitle":"借款用途",
					              'sClass':"text-center"
						     },
			            
			         ],
			         
					 fnServerParams: function (aoData) {  //查询条件
		             	aoData.push({ "name": "phoneNum", "value": $("#phoneNum").val() } );
		             },
				});
				
				 $('#query').click(function(){
					$('#example').dataTable().fnDraw();
				});
			
			});
			</script>
	</div>
</shiro:hasPermission>